package com.sunlands.deskmate.repository;

import com.sunlands.deskmate.domain.TzChatRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author shixiaopeng
 */
@Repository
public interface TzChatRecordRepository extends JpaRepository<TzChatRecord, Long> {

    @Query(value = "select * from tz_chat_record where type = ?1  and (extras = 'null' or extras = '{}' ) ORDER BY create_time desc ", nativeQuery = true)
    List<TzChatRecord> findBySql(String type);
}
